<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<!-- <script>
    let attrParams = { attrName: '收集', attrValueList: [{ id: 1, name: '苹果' }, { id: 2, name: '安卓' }] };
    //Object.assign,合并对象
    let newObj = { attrName: '', attrValueList: [], a: 100 };
    Object.assign(attrParams, newObj);
    console.log(attrParams);
</script>


<script>


    //深拷贝|浅拷贝
    //深拷贝:你变我不变
    //浅拷贝:你变我也变

    let obj = { a: 1, b: '我爱你', c: true };
    let obj1 = { a: 2, b: 3, c: false };
    Object.assign(obj,obj1);
     obj1.a = 100;
    console.log(obj,'obj与obj长得一模一样');
</script> -->

<script>

    // let obj= {};
    // let obj1 = {a:1,b:2,c:[{d:1},{d:2}]};
    // Object.assign(obj,obj1);
    // obj1.c[0].d = '测试我是obj1属性值发生变化';
    // console.log(obj);


    //Object.assign:合并对象，如果属性值都是基本类型->深拷贝
    //如果属性值有引用类型的数据,浅拷贝


    let arr = [6,6,6,6];
    let result = arr.every(item => {
        return item == 6;
    });
    console.log(result);
</script>